package com.wei.tang.ui.me;

import com.wei.tang.AppConest;
import com.wei.tang.AppContext;
import com.wei.tang.R;
import com.wei.tang.base.BaseActivity;
import com.wei.tang.widget.dialog.DialogSmallCancel;

import android.content.DialogInterface;
import android.content.Intent;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import butterknife.InjectView;
import butterknife.OnClick;

public class SettingActivity extends BaseActivity {
	private SettingActivity mySelf = this;

	@Override
	public int getLayoutId() {
		return R.layout.activity_setting;
	}

	@Override
	public void initView() {
	}

	@Override
	@OnClick({ R.id.ll_my_info_about, R.id.ll_my_info_feedback, R.id.btn_exit })
	public void onClick(View v) {
		int id = v.getId();
		switch (id) {
		case R.id.ll_my_info_about:
			mySelf.finish();
			break;
		case R.id.ll_my_info_feedback:
			mySelf.finish();
			break;
		case R.id.btn_exit:
			DialogSmallCancel.Builder builder = new DialogSmallCancel.Builder(mySelf, R.layout.dialog_small_cancel);
			builder.setMessage("确定要退出吗？");
			builder.setTitle("提示");
			builder.setPositiveButton("确定", new DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					dialog.dismiss();
					AppContext.getInstance().userLogout();
					mySelf.finish();
				}
			});

			builder.setNegativeButton("取消", new android.content.DialogInterface.OnClickListener() {
				public void onClick(DialogInterface dialog, int which) {
					dialog.dismiss();
				}
			});
			builder.create().show();
			break;
		}
	}

	@Override
	public void initData() {
	}
}
